{% extends "base.html" %}

{% block css %}
<link rel="stylesheet" href="/static/css/curator.css" />
<link rel="stylesheet" href="/static/css/adv_search.css" />

{% endblock %}

{% block content %}

<section id="main">


  <div id="update_results" style="text-align:center; display:block" >
  <form method="post" action="/curate_videos" class="form-horizontal" id="search">
    <input type="hidden" name="selected_sort_option" id="selected_sort_option" value="published" />
    <div class="input-append">
      <input type="text" name="search_video" style="width:508px;" placeholder="Search for a specific video titles or descriptions" value="" />
      <img id="adv_form" style="z-index:100; position:relative; left:-25px;" data-title="Click to show and hide advanced search options" src="/static/img/arrow_down.png"></img>
      <a style="left:-21px" href="" id="searchButton" class="btn btn-primary"><i class="icon-search"></i></a>
    </div>





<div id="adv_search" style="height:0px; overflow:hidden;">
<section class="ac-container">
	<div >
		<input id="ac-1" name="headmenu" type="checkbox" />
		<label for="ac-1" name="headmenu">Tags</label>
		<article class="ac-small">   
              
			<ul class="unstyled" id="multi-column">
       {% for tag_name in tagging_checkboxes %}
         <li><label><input  name="search_tagging" type="checkbox" value="{{tag_name}}">{{tag_name}}</label></li>
       {% endfor %}
      </ul>
		</article>
	</div>

	<div>
		<input id="ac-2" name="headmenu" type="checkbox" />
		<label for="ac-2" name="headmenu">Partners/Playlists</label>
		<article class="ac-medium">
			<ul class="unstyled" id="multi-column">
    {% for partner in partners_list %}
      <li>
      <label> <input  type="checkbox" name="partners" value="{{partner}}"
       id="pa{{forloop.counter}}"/><a target="_blank" href="http://www.youtube.com/user/{{partner}}">{{partner|truncate_dot:15}}</a></label>
      </li>
    {% endfor %}
    {% for pl in playlist_list %}
      <li>
      <label>
       <input type="checkbox" name="playlists" value="{{pl.playlist.playlistid}}"
       id="pa{{forloop.counter}}"/><a target="_blank" href="http://www.youtube.com/playlist?list={{pl.playlist.playlistid}}">{{pl.playlist.playlist_name|truncate_dot:15}}</a></label>
      </li>
    {% endfor %}
  </ul>
		</article>

	</div>


	<div>
		<input id="ac-3" name="headmenu" type="checkbox" />
		<label for="ac-3" name="headmenu">Geos</label>
		<article class="ac-medium">
			<ul class="unstyled" id="multi-column">
  {% for geo in geo_filter_options %}
    <li><label><input type="checkbox" name="geo_filters" value="{{geo}}" />{{ geo }}</label></li>
  {% endfor %}
  </ul>
		</article>
	</div>			
</section>


</form>
</div>    


  <section class="header">
    <ul class="nav nav-pills" id="order_by">
      <li class="dropdown">
        <a class="dropdown-toggle" data-toggle="dropdown" href="">
            Sort by <span id="order_by_field">Date</span> <b class="caret"></b>
          </a>
        <ul class="dropdown-menu pull-right">
          <li><a href="#" data-order="published">Date</a></li>
          <li><a href="#" data-order="view_count">Views</a></li>
        </ul>
      </li>
    </ul>

    <h3><span id="total_videos">{{ total_videos }}</span> video{{ total_videos|pluralize }}
  </section>


<!-- Video Curation block -->  
{{ video_content }}
<!-- end curation block -->

</section>

<div class="row-fluid show-grid">
              <div class="span4"><a id="get_less_videos" class="btn disabled" href="#">&#60;&#60; Prev </a></div>
              <div class="span4" style="text-align:center">Page <span id="page_index">1</span></div>
              <div class="span4" style="text-align:right"><a id="get_more_videos" class="btn" href="#">Next &#62;&#62;</a></div>
            </div>
{% endblock %}


{% block foot_js_lab %}
  .script('/static/js/bootstrap-extras.js')
  .script('/static/js/jquery.lazyload.min.js')
  .script('/static/js/jquery.quicksearch.js').wait()
  .script('/static/js/curator.js')  
{% endblock %}
